<%@page contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<jsp:include page="header.jsp" />
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page session="false" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<body>
    <jsp:include page="top.jsp" />
    <jsp:include page="sitebar.jsp" />

    <h1>
        <c:choose>
            <c:when test="${person.id > 0}">
                Editing Quote ${person.id} - ${person.quote}  ${person.category} ${person.vote}
            </c:when>
            <c:otherwise>
                Submit Quote
            </c:otherwise>
        </c:choose>
    </h1>
    <form:form commandName="person" style="padding:8px">
        ID - ${person.id}<br/>
        Quote<br/>
        <form:textarea rows="10" cols="45" path="quote"/><br/>
        Category<br/>
        <form:select path="category">
            <form:option value="Fun" label="Fun" />
            <form:option value="Popular" label="Popular" />
            <form:option  value="Other" label="Other" />
        </form:select>
        <br/>
        
        <c:if test="${person.id > 0}">
            Votes<br/>
            <form:input path="vote"></form:input>
            <br/>
            <a href="<%=request.getContextPath()%>/admin/remove?id=${person.id}">Remove</a>
            <br/><br/>
        </c:if>
            

        <input type="submit" value="Save"/>
    </form:form>
</body>
</html>
